#include "console.h"
#include "print.h"
#include "sync.h"

static struct mutex_t console_lock;

void console_init() { mutex_init(&console_lock); }

void console_acquire() { mutex_acquire(&console_lock); }

void console_release() { mutex_release(&console_lock); }

void console_put_str(char* str)
{
  console_acquire();
  put_str(str);
  console_release();
}

void console_put_char(uint8_t char_asci)
{
  console_acquire();
  put_char(char_asci);
  console_release();
}

void console_put_int(uint32_t num)
{
  console_acquire();
  put_int(num);
  console_release();
}
